// index.js
// 获取应用实例
var _app = require("../../npm/app.js");
class Index extends _app.Component {
  constructor() {
    super();
    this.state = {
      count: 0,
      name: 'name'
    };
  }
  componentDidMount() {
    console.log('执行componentDidMount');
    // this.setState({
    //   count: 1
    // });
  }
  onAddClick() {
    this.setState({
      count: this.state.count + 1,
      name: `${this.state.name}${this.state.count}`
    });
  }
  onReduceClick() {
    this.setState({
      count: this.state.count - 1,
      name: `${this.state.name}${this.state.count}`
    });
  }
}
Index.$$events = ['onAddClick','onReduceClick']
Page(require('../../npm/app.js').createPage(Index))